package com.aaie.gru.user.controller;


import com.aaie.gru.response.ResMessage;
import com.aaie.gru.user.entity.GruSysGuardianSchoolMapVo;
import com.aaie.gru.user.service.IGruSysGuardianSchoolMapService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 监护人和学校映射表（多对多） 前端控制器
 * </p>
 *
 * @author lvxing
 * @since 2019-08-17
 */
@Api(tags = "学校和监护人映射模块")
@RestController
@RequestMapping("/user")
public class GruSysGuardianSchoolMapController {

    @Autowired
    IGruSysGuardianSchoolMapService gruSysGuardianSchoolMapService;

    @ApiOperation(value = "按监护人id获取学校和监护人映射关系列表", notes = "按监护人id获取学校和监护人映射关系列表")
    @GetMapping("/getSchoolListByGuardian")
    public String getSchoolListByGuardian(String guardianId) {
        List<GruSysGuardianSchoolMapVo> schoolListByGuardian = gruSysGuardianSchoolMapService.getSchoolListByGuardian(guardianId);
        return ResMessage.ok(schoolListByGuardian);
    }

}
